﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Able.Api.Tests.Controllers
{
    [TestClass]
    public class PushInfo : BaseControllerTest
    {
        public PushInfo()
        {
            url = ApiHelper.Url + "PushInfo/";
            dict.Add("siteId", siteId);
            dict.Add("langFlag", langFlag);
        }

        [TestMethod]
        public void GetList()
        {
            url += "GetList";
            dict.Add("pageindex", 1);
            dict.Add("pageSize", 2);

            str = ApiHelper.SendGet(url, dict);
            RightAssert();
        }


        [TestMethod]
        public void GetOrderMessages()
        {
            url += "GetOrderMessages";
            var data = "?siteId=19&langFlag=tw&memberId=1181&currencyflag=cny&pageindex=1&pagesize=10&lastGetTime=1494891999";

            str = ApiHelper.SendGet(url + data);
            RightAssert();
        }

        [TestMethod]
        public void GetPreferentialMessages()
        {
            url += "GetPreferentialMessages";
            var data = "?siteId=19&langFlag=tw&memberId=1248&currencyflag=cny&pageindex=1&pagesize=10&lastGetTime=1494891999";

            str = ApiHelper.SendGet(url + data);
            RightAssert();
        }
        [TestMethod]
        public void AddDevice()
        {
            url += "adddevice";
            var data = "siteId=19&key=&langflag=tw&memberId=0&currencyflag=(null)&deviceType=1&pushRegisterId=cfa8d6f52eb805cdf3bd30cce99f3ff08fe6fafb419387ae5a03be0952b93240";

            str = ApiHelper.SendPost(url, data);
            RightAssert();
        }
    }
}
